package dev.touchswipe.ScreenLock.settingsManager
{
	import flash.filesystem.File;
	import flash.utils.ByteArray;
	
	import mx.utils.SHA256;

	public class Settings
	{
		public function Settings()
		{
			
		}
		
		public static const VERSION:Number=3;
		
		private var _background:String=File.applicationDirectory.nativePath+"\\default_background.jpg";
		public function get background():String{
			return _background;
		}
		public function set background(value:String):void{
			_background=value;
		}
		
		public var showClock:Boolean=true;
		
		public var pinHash:String="";
		public function setPin(pin:String):void{
			if(pin.length==4&&(Math.floor(Number(pin))==Math.ceil(Number(pin)))){
				var ba:ByteArray=new ByteArray();
				ba.writeMultiByte(pin,"us-ascii");
				pinHash=SHA256.computeDigest(ba);
			}
		}
	}
}